@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

* {
 padding: 0;
 margin: 0;
 border: 0;
}


*,
*:before,
*:after {
 -webkit-box-sizing: border-box;
 -moz-box-sizing: border-box;
 box-sizing: border-box;
}


:focus,
:active {
 outline: none;
}
a:focus,
a:active {
 outline: none;
}


nav,
footer,
header,
aside {
 display: block;
}


html,
body {
 height: 100%;
 width: 100%;
 font-size: 100%;
 line-height: 1;
 font-size: 14px;
 -ms-text-size-adjust: 100%;
 -moz-text-size-adjust: 100%;
 -webkit-text-size-adjust: 100%;
 overscroll-behavior-y: none;
}


input,
button,
textarea {
 font-family: inherit;
}


input::-ms-clear {
 display: none;
}
button {
 cursor: pointer;
}
button::-moz-focus-inner {
 padding: 0;
 border: 0;
}
a,
a:visited {
 text-decoration: none;

}
a{
  color: #000 ;
}
a:hover {
 text-decoration: none;

}
ul li {
 list-style: none;
}
img {
 vertical-align: top;
}
h1,
h2,
h3,
h4,
h5,
h6 {
 font-size: inherit;
 font-weight: 400;
}
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
body{
  background: rgb(93, 19, 197);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: 'Press Start 2P', cursive;
}
h1{
  margin-top: 20px;
  font-size: 40px;
  color: rgb(0, 255, 242)
}
.wrapper{
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
}
.game__body{
  border: solid 10px rgb(160, 132, 207);
  background:  rgb(160, 132, 207);
  position: relative;
  border-radius: 5px;
}
.game__shadows{
  display: grid;
  grid-template-columns: repeat(4, 100px);
  grid-template-rows: repeat(4, 100px);
  grid-gap: 10px;
}
.shadow{
  background: rgb(116, 46, 207);
  height: 100%;
  width: 100%;
}

.square{
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 50px;
  transition: all 0.1s ease-in-out 0s;
}
.square.animation{
  animation: 0.1s ease 0s alternate scale;
}
.square[data-value="2"]{
  background: #65adff;
  z-index: 2;
}
.square[data-value="4"]{
  background: #3964ff;
  z-index: 4;
}

.square[data-value="8"]{
  background: #8a51f4;
  z-index: 8;
}
.square[data-value="16"]{
  background: #d151f4;
  z-index: 16;
}
.square[data-value="32"]{
  background: #00fbff;
  z-index: 32;
}
.square[data-value="64"]{
  background: #ff60ec;
  z-index: 64;
}
.square[data-value="128"]{
  background: #f451a0;
  z-index: 128;
  font-size: 30px;
}
.square[data-value="256"]{
  background: #24ff8e;
  z-index: 256;
  font-size: 30px;

}

.square[data-value="512"]{
  background: #84ff9c;
  z-index: 512;
  font-size: 30px;

}
.square[data-value="1024"]{
  background: #fff245;
  z-index: 1024;
  font-size: 10px;
}
.square[data-value="2048"]{
  background: #f45151;
  z-index: 2048;
  font-size: 10px;
}
.square[data-value="4096"]{
  background: rgb(255,0,0);
  background: linear-gradient(90deg, rgba(255,0,0,1) 0%, rgba(255,0,245,1) 9%, rgba(123,0,255,1) 16%, rgba(23,39,255,1) 22%, rgba(21,159,255,1) 29%, rgba(19,255,248,1) 36%, rgba(17,251,138,1) 43%, rgba(48,248,16,1) 49%, rgba(175,244,43,1) 55%, rgba(208,240,71,1) 62%, rgba(231,236,100,1) 68%, rgba(255,184,0,1) 75%, rgba(255,188,0,1) 81%, rgba(255,115,0,1) 87%, rgba(255,46,0,1) 93%, rgba(255,0,0,1) 100%);    z-index: 4096;
  font-size: 10px;
}

@keyframes scale{
  0%{
    transform: scale(1)
  }
  100%{
    transform: scale(1.15);
  }
}

.score{
  color: #fff;
  margin-bottom: 10px;
}
@media (max-width:470px) {
  .game__body{
    transform: scale(0.7);
  }
}
.lose, .winner{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: rgba(122, 0, 204, 0.9);
  padding: 50px 75px;
  transition: all 0.5s ease-in-out 0s;
  opacity: 0;
  z-index: -1;
}
.winner{
}
.lose.active, .winner.active{  
    z-index: 10000;
    opacity: 1;
  }

.lose-title, .winner-title{
  text-align: center;
  font-size: 30px;
  margin-bottom: 50px;
}
.lose-close, .winner-close{
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(0, -50%);
  font-size: 40px;
  cursor: pointer;
}
.lose-score, .winner-score{
  margin-bottom: 50px;
  font-size: 20px;
}
.lose-buttons, .winner-buttons{
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
}
.lose-retry, .retry, .winner-retry{
padding: 20px;
position: relative;
  
cursor: pointer;
background: #de8006;
border: 0px;
position: relative;
box-shadow: 
  inset -4px 2px 1px 1px grey,
  inset -4px -2px 1px 1px lightgray,
  inset 4px 0px 1px 1px lightgray;   
}

.lose-retry::after, .retry::after, .winner-retry::after {
  content: '';
  background: black;
  position: absolute;
  left: -2.5%;
  top: 0;
  width: 105%;
  height: 100%;
  z-index: -1;
}
.lose-retry::before, .retry::before, .winner-retry::before {
  content: '';
  background: black;
  position: absolute;
  left: 0;
  top: -5%;
  width: 100%;
  height: 113%;
  z-index: -1;
}
.retry{
  display: inline-flex;
  margin-bottom: 20px;
  padding: 10px 20px;
  background: #065cde;
}
.signature{
  position: absolute;
  bottom: 5px;
  right: 5px;
  font-size: 10px;
}

@media (max-width:470px) {
  .game{
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}